import request from "@/utils/request";

// 设备列表
export function getDevicelist(params) {
  return request({
    url: "/device/archive/list",
    method: "get",
    params,
  });
}

// 详情
export function detail(id) {
  return request({
    url: `/device/archive/${id}`,
    method: "get",
  });
}
// 新增
export function add(data) {
  return request({
    url: "/device/archive",
    method: "post",
    data,
  });
}
// 编辑
export function edit(data) {
  return request({
    url: "/device/archive",
    method: "put",
    data,
  });
}

// 报警列表
export function getAlarmlist(params) {
  return request({
    url: "/device/emeter/alarm/data",
    method: "get",
    params,
  });
}

// 报警详情
export function getAlarmdetail(id) {
  return request({
    url: `/device/emeter/alarm/detail/${id}`,
    method: "get",
  });
}

// 处理
export function release(params) {
  return request({
      url: "/device/emeter/manual/release",
      method: "get",
      params,
  });
}

// 采集记录
export function getCollectlist(params) {
  const { pageNum, pageSize, id } = params;
  return request({
    url: `/device/emeter-data/collect/${id}?pageNum=${pageNum}&pageSize=${pageSize}`,
    method: "get",
  });
}

// 采集详情
export function getCollectdetail(data) {
  const { id, deviceCode } = data;
  return request({
    url: `/device/emeter-data/detail/remaking/?id=${id}&deviceCode=${deviceCode}`,
    method: "get",
  });
}

// 巡检记录
export function getChecklist(params) {
  const { pageNum, pageSize, id } = params;
  return request({
    url: `/device/emeter-data/device/check/${id}?pageNum=${pageNum}&pageSize=${pageSize}`,
    method: "get",
  });
}

// 报警列表 - 水
export function getAlarmwaterlist(params) {
  return request({
    url: "/device/wmeter/alarm/data",
    method: "get",
    params,
  });
}

// 报警详情 - 水
export function getAlarmwaterdetail(id) {
  return request({
    url: `/device/wmeter/alarm/detail/${id}`,
    method: "get",
  });
}

// 采集记录 - 水
export function getCollectwaterlist(params) {
  const { pageNum, pageSize, id } = params;
  return request({
    url: `/wmeter/data/collect/${id}?pageNum=${pageNum}&pageSize=${pageSize}`,
    method: "get",
  });
}

// 巡检记录 - 水
export function getCheckwaterlist(params) {
  const { pageNum, pageSize, id } = params;
  return request({
    url: `/wmeter/data/device/check/${id}?pageNum=${pageNum}&pageSize=${pageSize}`,
    method: "get",
  });
}
